package main

import (
	"MiddleWareUtil/kafkaU"
	"context"
	"fmt"
	"github.com/segmentio/kafka-go"
)

func main() {
	product := kafkaU.GetKafkaProduct()
	var msg = kafka.Message{Topic: "topic-A", Value: []byte("{\"deviceId\": \"KIBO862447\", \"srcIp\": \"172.18.132.22\", \"srcMac\": \"FE:FC:FE:A7:96:CB\", \"dstIp\": \"172.18.133.251\", \"dstPort\": 3306, \"timestamp\": 1632646877047, \"count\": 5}")}
	err := product.WriteMessages(context.Background(), msg)
	if err != nil {
		panic(err)
	}
	fmt.Println(product)
	err = product.Close()
	if err != nil {
		panic(err)
	}
}
